<?php


namespace app\common\model\manystore;


use think\Model;

class Banji extends Model
{

    // 表名,不含前缀
    protected $name = 'manystore_banji';
    // 自动写入时间戳字段
    protected $autoWriteTimestamp = false;
    // 定义时间戳字段名
    protected $createTime = false;
    protected $updateTime = false;
    // 追加属性
    protected $append = [
        'teacher'
    ];

    public function getTeacherAttr($value, $data)
    {
      return Teacher::get(['is_work' => 1, 'banji_id' => $data['id']]);
    }
}